import React from 'react';
import { bem } from "@/utils";
import Stepper from '../stepper';

export interface SkuStepperProps {
    value?: number;
    onChange?(value: number): void;
}

const SkuStepper: React.FC<SkuStepperProps> = (props) => {
    const {
        value,
        onChange,
        ...rest
    } = {
        ...props
    };
    const b = bem('sku');

    return (
        <div className={b('stepper')}>
            <div className={b('quantity')}>
                <div className={b('quantity-title')}>数量</div>

                <Stepper
                    value={value}
                    defaultValue={1}
                    onInputChange={onChange}
                />
            </div>
        </div>
    );
};

export default SkuStepper;